package oom;

import java.util.ArrayList;
import java.util.List;

class HeapObject {}

/**
 * -Xmx20m -XX:+HeapDumpOnOutOfMemoryError
 */
public class HeapDemo {
    public static void main(String[] args) {
        List<HeapDemo> list = new ArrayList<>();
        for(;;)
            list.add(new HeapDemo());
    }
}
